home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
011
/
arc42s.lbr
/
ARCDEL.MQC
/
arcdel.mac
Wrap
Text File
|
1985-08-04
|
3KB
|
62 lines
/* ARC - Archive utility - ARCDEL
$define(tag,$$segment(@1,$$index(@1,=)+1))#
$define(version,Version $tag(
TED_VERSION DB =2.04), created on $tag(
TED_DATE DB =04/17/85) at $tag(
TED_TIME DB =11:30:48))#
$undefine(tag)#
$version
(C) COPYRIGHT 1985 by System Enhancement Associates; ALL RIGHTS RESERVED
By: Thom Henderson
Description:
This file contains the routines used to delete entries
in an archive.
Language:
Computer Innovations Optimizing C86
*/
#include <stdio.h>
#include "arc.h"
delarc(num,arg) /* remove files from archive */
int num; /* number of arguments */
char *arg[]; /* pointers to arguments */
{
struct heads hdr; /* header data */
int del; /* true to delete a file */
int n; /* index */
if(!num) /* she must specify which */
abort("You must tell me which files to delete!");
openarc(1); /* open archive for changes */
while(readhdr(&hdr,bak)) /* while more entries in archive */
{ del = 0; /* reset delete flag */
for(n=0; n<num; n++) /* for each template given */
{ if(match(hdr.name,arg[n]))
{ del = 1; /* turn on delete flag */
break; /* stop looking */
}
}
if(del) /* skip over unwanted files */
{ fseek(bak,hdr.size,1);
if(note)
printf("Deleting file: %s\n",hdr.name);
}
else /* else copy over file data */
{ writehdr(&hdr,arc); /* write out header and file */
filecopy(bak,arc,hdr.size);
}
}
hdrver = 0; /* special end of archive type */
writehdr(&hdr,arc); /* write out archive end marker */
closearc(1); /* close archive after changes */
}